<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/7/22
 * Time: 13:06
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Banner extends Model
{
    use SoftDeletes;
    protected $table = 'banner';
    protected $url = 'http://youmi-tonggu.oss-cn-zhangjiakou.aliyuncs.com'; //oss地址
    protected $appends = ['file_path'];

    /**
     * 获取图片完整路径
     * @return string
     */
    public function getFilePathAttribute()
    {
        return $this->url . '/' . $this->path;
    }
}